home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / include / gfx / nsIBlender.h < prev    next >
C/C++ Source or Header  |  2006-05-08  |  5KB  |  109 lines

  1. /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  2. /* ***** BEGIN LICENSE BLOCK *****
  3.  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  4.  *
  5.  * The contents of this file are subject to the Mozilla Public License Version
  6.  * 1.1 (the "License"); you may not use this file except in compliance with
  7.  * the License. You may obtain a copy of the License at
  8.  * http://www.mozilla.org/MPL/
  9.  *
  10.  * Software distributed under the License is distributed on an "AS IS" basis,
  11.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  12.  * for the specific language governing rights and limitations under the
  13.  * License.
  14.  *
  15.  * The Original Code is mozilla.org code.
  16.  *
  17.  * The Initial Developer of the Original Code is
  18.  * Netscape Communications Corporation.
  19.  * Portions created by the Initial Developer are Copyright (C) 1998
  20.  * the Initial Developer. All Rights Reserved.
  21.  *
  22.  * Contributor(s):
  23.  *
  24.  * Alternatively, the contents of this file may be used under the terms of
  25.  * either of the GNU General Public License Version 2 or later (the "GPL"),
  26.  * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  27.  * in which case the provisions of the GPL or the LGPL are applicable instead
  28.  * of those above. If you wish to allow use of your version of this file only
  29.  * under the terms of either the GPL or the LGPL, and not to allow others to
  30.  * use your version of this file under the terms of the MPL, indicate your
  31.  * decision by deleting the provisions above and replace them with the notice
  32.  * and other provisions required by the GPL or the LGPL. If you do not delete
  33.  * the provisions above, a recipient may use your version of this file under
  34.  * the terms of any one of the MPL, the GPL or the LGPL.
  35.  *
  36.  * ***** END LICENSE BLOCK ***** */
  37.  
  38. #ifndef nsIBlender_h___
  39. #define nsIBlender_h___
  40.  
  41. #include "nscore.h"
  42. #include "nsISupports.h"
  43. #include "nsIRenderingContext.h"
  44.  
  45. // IID for the nsIBlender interface
  46. #define NS_IBLENDER_IID    \
  47. { 0xbdb4b5b0, 0xf0db, 0x11d1, \
  48. { 0xa8, 0x2a, 0x00, 0x40, 0x95, 0x9a, 0x28, 0xc9 } }
  49.  
  50. //----------------------------------------------------------------------
  51.  
  52. // Blender interface
  53. class nsIBlender : public nsISupports
  54. {
  55. public:
  56.   NS_DEFINE_STATIC_IID_ACCESSOR(NS_IBLENDER_IID)
  57.  
  58.   /**
  59.    * Initialize the Blender
  60.    * @update dc 11/4/98
  61.    * @param  aContext is where the blender can get info about the device its blending on
  62.    * @result The result of the initialization, NS_OK if no errors
  63.    */
  64.   NS_IMETHOD Init(nsIDeviceContext *aContext) = 0;
  65.  
  66.   /**
  67.    * NOTE: if we can make this static, that would be great. I don't think we can.
  68.    * Blend source and destination nsDrawingSurfaces. Both drawing surfaces
  69.    * will have bitmaps associated with them.
  70.    * @param aSX x offset into source drawing surface of blend area
  71.    * @param aSY y offset into source drawing surface of blend area
  72.    * @param aWidth width of blend area
  73.    * @param aHeight width of blend area
  74.    * @param aSrc  source for the blending
  75.    * @param aDest destination for blending
  76.    * @param aDX x offset into destination drawing surface of blend area
  77.    * @param aDY y offset into destination drawing surface of blend area
  78.    * @param aSrcOpacity 0.0f -> 1.0f opacity value of source area. 1.0f indicates
  79.    *        complete opacity.
  80.    * @param aSecondSrc an optional second source drawing surface which is used in
  81.    *        conjunction with the background color parameters to determine
  82.    *        which pixels to blend
  83.    * @param aSrcBackColor color of pixels in aSrc that should be
  84.    *        considered "background" color
  85.    * @param aSecondSrcBackColor color of pixels in aSrc that should be
  86.    *        considered "background" color
  87.    */
  88.   NS_IMETHOD Blend(PRInt32 aSX, PRInt32 aSY, PRInt32 aWidth, PRInt32 aHeight,nsIDrawingSurface* aSrc,
  89.                    nsIDrawingSurface* aDest, PRInt32 aDX, PRInt32 aDY, float aSrcOpacity,
  90.                    nsIDrawingSurface* aSecondSrc = nsnull, nscolor aSrcBackColor = NS_RGB(0, 0, 0),
  91.                    nscolor aSecondSrcBackColor = NS_RGB(0, 0, 0)) = 0;
  92.  
  93.   NS_IMETHOD Blend(PRInt32 aSX, PRInt32 aSY, PRInt32 aWidth, PRInt32 aHeight, nsIRenderingContext *aSrc,
  94.                    nsIRenderingContext *aDest, PRInt32 aDX, PRInt32 aDY, float aSrcOpacity,
  95.                    nsIRenderingContext *aSecondSrc = nsnull, nscolor aSrcBackColor = NS_RGB(0, 0, 0),
  96.                    nscolor aSecondSrcBackColor = NS_RGB(0, 0, 0)) = 0;
  97.  
  98.   /**
  99.    GetAlphas computes an array of alpha values for a rectangle of pixels, using
  100.    the drawn-onto-black and the drawn-onto-white images. The pixels are
  101.    returned in a new'ed array of aRect.width*aRect.height elements, in row-major
  102.    order. This array must be freed by the caller.
  103.   */
  104.   NS_IMETHOD GetAlphas(const nsRect& aRect, nsIDrawingSurface* aBlack,
  105.                        nsIDrawingSurface* aWhite, PRUint8** aAlphas) = 0;
  106. };
  107.  
  108. #endif
  109.